package com.broada.apm.topo;

import com.broada.apm.model.Resource;


public class TAppResource extends TResource<TAppService> implements Apdexable {
	protected static final int SATISFACTION_THRESHOLD = 3 * 1000 * 1000;// 3秒
	private long apdexT;
	public TAppResource(Resource resource, String id, long ip, int port, int protocol, String protocolName, String uri) {
		super(resource, id, ip, port, protocol, protocolName, uri);
		updateApdexT();
	}
	public long getApdexT() {
	    return apdexT;
	}
	private void updateApdexT() {
	    if (resource != null) {
             apdexT = (long) (resource.getApdex_t() * 1000 * 1000);
        } else {
            apdexT = DEFAULT_SATISFACTION_THRESHOLD;
        }
	}
}
